1. Technical Field
The invention relates to combining a network stack with a modem core for use in both computer and non-computer applications. More particularly, the invention relates to an Internet-aware modem which combines any number of point-to-point devices with the network protocols necessary to communicate on the Internet, where these devices include various speed traditional modems from 2400 kbps to 56 kbps, ISDN modems, newer xDSL modems, and digital cellular modems.
2. Description of the Prior Art
Computer modems were developed in a time when most connections were made to proprietary online services, interactive terminals, bulletin board services (BBSs), or corporate network systems. As such, it was necessary to implement connection protocols in software because there existed at the time a number of such protocols. These protocols included x-modem, y-modem, z-modem, kermit, and interactive character based interfaces.
Today, with popularity of the Internet, a vast majority of modems are now used exclusively to connect with ISP""s, which in turn connect the user to the Internet. Therefore, there is now a predominant set of connection protocols. Such protocols are used for most modem connections. Accordingly, there is a real need and advantage in designing a modem that is Internet-ready.
The connection protocols used by the Internet and their hierarchical relationship are shown in FIG. 1. These protocols include TCP 10, IP 11, UDP 13, and PPP 12. Optimizing a modem for use with the Internet offers many advantages including reduced transmission latency, reduced servicing requirements, lower processing requirements from the system""s CPU, and optimized transmission rates.
Current computer systems treat a modem subsystem as a serial device. A block diagram of an existing system is shown in FIG. 2. In such systems, an Internet application, such as a Web browser 21, is run in software 19 on the main CPU 22. This application, in turn calls upon the computer network stack 23, which is also implemented in software. The network stack implements the TCP, IP, UDP, and PPP protocols. Once the data have been processed, the resulting packets are sent by the CPU via the computer bus 28 to a serial port interface 27 in the modem system 20. The modem system, for example a modem card 18, is seen as a serial I/O device by the host processor. These devices usually accept data in byte quantities and place them in an outgoing FIFO 24. These FIFOs can be anywhere from 8 bytes to 64 bytes. The CPU normally writes a fixed number of bytes, then waits for the serial I/O device to notify it that all the data have been sent and that it is ready to accept more data. This notification is usually done via system interrupts. The packet data, after it is written into the FIFO, is fed to the modem core 25 at the outgoing data rate and thence to the telephone line 29.
For received data, the modem first places all incoming packets into the input FIFO 26. The device can then be configured to interrupt the host CPU when any data are available or when the received data reaches some level (i.e. 16 bytes). When notified, the CPU reads all the data in the input FIFO, and stores the data temporarily in a buffer in system memory (not shown). The bottom protocol, PPP (see FIG. 1) can start to process the data, but it cannot pass up the data to the next layer until the entire packet is received.
Once the whole packet is received, the PPP portion of the software network stack passes the data up to the second protocol (IP). The IP software then processes the IP header and, after verifying the header checksum, passes the packet to the TCP handler. The TCP handler then checks its checksum, and passes the data on to the appropriate application, as specified by the PORT number in the TCP header.
Because most modems in computers today are used to connect to the Intemet, it makes it economically feasible and practical to optimize a modem for this environment. What this entails is embedding in the modem system, the ability to handle the necessary network protocols and use the knowledge of the protocols to tune the transmission characteristics of the modem. This is the same rationale behind the popularity of Window""s accelerator graphics cards. Because graphic chip manufacturers know that a vast majority of PC""s today run the Microsoft Windows(copyright) operating system, they fine-tune their architectures to enhance the performance in this environment. This would not be practical if there were a number of operating systems with different graphic APIs, each with a significant portion of the market place. However, with the one over-riding standard, most graphic card manufactures have chosen to optimize their hardware for the Windows environment, even though today""s Pentium class processors are very capable of handling the graphic chores without external support. This is because the function is required in most circumstances, and it is advantageous to offload the host processor so that it has that much more MIPs to run standard applications.
A similar situation now exists in the modem card market. It would therefore be advantageous to embed the Intemet network protocol stack, along with special logic, thereby enabling the modem device to become Intemet-ready, such that the modem system offloads much of the network protocol processing from the main CPU, while improving the overall performance of the communication system.
The invention embeds the Internet network protocol stack, along with special logic, thereby enabling the modem device to become Internet-ready. As a result, the modem system offloads much of the network protocol processing from the main CPU and improves the overall performance of the communication system. The invention provides an Internet-aware modem which combines any number of point-to-point devices with the network protocols necessary to communicate on the Internet, where these devices include various speed traditional modems from 2400 kbps to 56 kbps, ISDN modems, newer xDSL modems, and digital cellular modems.
Sending Data
In a system equipped with an Internet-ready modem, the Internet application first sets up the socket parameters. These include the destination port number, the type of connection (TCP/UDP), the TOS (Type-Of-Service) requirements, and the destination IP address. When the network stack on an Internet-ready modem card gets this information, it attempts to start a connection by sending out a SYN packet. This packet is passed to the IP engine, which attaches the IP header and calculates the IP header checksum. The packet is then passed to the PPP handler which attaches the PPP header, appends the PPP checksum, and escapes the data. After PPP encapsulation, the resulting network packet is sent through the output FIFO to the modem core. For this packet, the TCP engine indicates to the packet analyzer block that it is a SYN packet. The packet analyzer then indicates to the modem that this is a stand alone packet and that it can be sent immediately. Upon receiving this information, the modem sends the network packet out without first waiting the normal 50 ms to see if additional information is forthcoming.
After the destination socket sends a return SYN-ACK packet, an ACK packet is sent from the modem card. This packet follows the same steps as those for the SYN packet.
At this point, the socket connection is up, and the application software (such as a Web browser) is notified. The application can now send its data directly to the modem in a data packet format. In this example, where the application is a Web browser, the application can send an HTTP request directly to the modem system via a packet interface as opposed to the serial port I/O interface in a regular modem system. DMA style data transports can be used for this purpose. In this method, a data byte count is programmed into the packet interface. Data can then be automatically transferred from memory into a modem card without further intervention from the host CPU. After all the data have been transferred, an interrupt from the modem card can be sent to the host CPU indicating that the data transfer is complete.
As the data arrive at the modem card, they are sent (in this example) to a TCP data output buffer. After all the data are received or when the maximum data size per packet has been received, the TCP block begins calculating the checksum. The packet is 415 encapsulated in the same way as the SYN packet. In parallel to this, the TCP engine indicates to the packet analyzer block that the destination port for the packet is 80, which is the well-known HTTP port. The packet analyzer then knows that there are no more data and, again, the modem should send the current packet immediately.
Receiving Data
When receiving network packets, the data are sent from the modem core through the input FIFO to the PPP engine, which parses the PPP header, unescapes the data, and starts a running check on the packet for checksum calculations. If the engine determines that the encapsulated data is an IP packet, it enables the IP engine, and all data past the PPP header is forwarded to the IP engine. The IP engine parses the IP header, checks the checksum, and if it determines that the encapsulated protocol is TCP, then it sends all data past the IP header to the TCP engine. The TCP engine then parses the TCP header and sends the data portion to the security layer. If the data is HTML data, it can be passed through a ratings check that parses out rating tags of pages. If the page has a rating below or equal to the modem cards setting, then the data are allowed to pass. If the rating exceeds the setting on the card, a message indicating so is passed on instead. If the page contains no ratings, a bit can be set to either pass or block the page. All non-HTML data are passed directly to the TCP data buffer.
As the data are being written into the buffer, a running count is kept to see how much data have been received. At the end of the network packet, if the PPP checksum indicates that the entire packet was received without errors, then an interrupt can be generated to the host CPU. The application can then read the received data count, and program a DMA transfer to transfer data from the TCP buffer into main memory.